/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gap.entities;

import com.buanalintas.framework.entities.MasterUnit;
import com.buanalintas.framework.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Mrs Yun KZ
 */
@Entity
@Table(name = "gap_master_history_employee")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "GapMasterHistoryEmployee.findAll", query = "SELECT g FROM GapMasterHistoryEmployee g"),
    @NamedQuery(name = "GapMasterHistoryEmployee.findByHistoryId", query = "SELECT g FROM GapMasterHistoryEmployee g WHERE g.historyId = :historyId"),
    @NamedQuery(name = "GapMasterHistoryEmployee.findByHistoryEmployeeName", query = "SELECT g FROM GapMasterHistoryEmployee g WHERE g.historyEmployeeName = :historyEmployeeName"),
    @NamedQuery(name = "GapMasterHistoryEmployee.findByHistoryPlatform", query = "SELECT g FROM GapMasterHistoryEmployee g WHERE g.historyPlatform = :historyPlatform"),
    @NamedQuery(name = "GapMasterHistoryEmployee.findByHistoryValue", query = "SELECT g FROM GapMasterHistoryEmployee g WHERE g.historyValue = :historyValue"),
    @NamedQuery(name = "GapMasterHistoryEmployee.findByHistoryTimestamp", query = "SELECT g FROM GapMasterHistoryEmployee g WHERE g.historyTimestamp = :historyTimestamp")})
public class GapMasterHistoryEmployee implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "history_id")
    private String historyId;
    @Column(name = "history_employee_name")
    private String historyEmployeeName;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "history_platform")
    private BigDecimal historyPlatform;
    @Column(name = "history_value")
    private BigDecimal historyValue;
    @Column(name = "history_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date historyTimestamp;
    @JoinColumn(name = "history_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser historyUserId;
    @JoinColumn(name = "history_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit historyUnitId;
    @JoinColumn(name = "history_employee_id", referencedColumnName = "employee_id")
    @ManyToOne
    private GapMasterEmployee historyEmployeeId;

    public GapMasterHistoryEmployee() {
    }

    public GapMasterHistoryEmployee(String historyId) {
        this.historyId = historyId;
    }

    public String getHistoryId() {
        return historyId;
    }

    public void setHistoryId(String historyId) {
        this.historyId = historyId;
    }

    public String getHistoryEmployeeName() {
        return historyEmployeeName;
    }

    public void setHistoryEmployeeName(String historyEmployeeName) {
        this.historyEmployeeName = historyEmployeeName;
    }

    public BigDecimal getHistoryPlatform() {
        return historyPlatform;
    }

    public void setHistoryPlatform(BigDecimal historyPlatform) {
        this.historyPlatform = historyPlatform;
    }

    public BigDecimal getHistoryValue() {
        return historyValue;
    }

    public void setHistoryValue(BigDecimal historyValue) {
        this.historyValue = historyValue;
    }

    public Date getHistoryTimestamp() {
        return historyTimestamp;
    }

    public void setHistoryTimestamp(Date historyTimestamp) {
        this.historyTimestamp = historyTimestamp;
    }

    public MasterUser getHistoryUserId() {
        return historyUserId;
    }

    public void setHistoryUserId(MasterUser historyUserId) {
        this.historyUserId = historyUserId;
    }

    public MasterUnit getHistoryUnitId() {
        return historyUnitId;
    }

    public void setHistoryUnitId(MasterUnit historyUnitId) {
        this.historyUnitId = historyUnitId;
    }

    public GapMasterEmployee getHistoryEmployeeId() {
        return historyEmployeeId;
    }

    public void setHistoryEmployeeId(GapMasterEmployee historyEmployeeId) {
        this.historyEmployeeId = historyEmployeeId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (historyId != null ? historyId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GapMasterHistoryEmployee)) {
            return false;
        }
        GapMasterHistoryEmployee other = (GapMasterHistoryEmployee) object;
        if ((this.historyId == null && other.historyId != null) || (this.historyId != null && !this.historyId.equals(other.historyId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gap.entities.GapMasterHistoryEmployee[ historyId=" + historyId + " ]";
    }
    
}
